package cn.com.bo.util.linux;

import cn.com.bo.util.PropUtils;
import ch.ethz.ssh2.Connection;

public class SSHModel {

	public Connection conn;
	public String hostname;
	public String username;
	public String password;
	public String command;

	public SSHModel() {

	}

	public SSHModel(String command) {
		this.command = command;
	}

	public Connection getConn() {
		if (conn == null) {
			conn = new Connection(getHostname());
		}
		return conn;
	}

	public void setConn(Connection conn) {
		this.conn = conn;
	}

	public String getHostname() {
		if (hostname == null) {
			hostname = PropUtils.get("ssh.hostname");
		}
		return hostname;
	}

	public void setHostname(String hostname) {
		this.hostname = hostname;
	}

	public String getUsername() {
		if (username == null) {
			username = PropUtils.get("ssh.username");
		}
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		if (password == null) {
			password = PropUtils.get("ssh.password");
		}
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCommand() {
		return command;
	}

	public void setCommand(String command) {
		this.command = command;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {

	}

}
